<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./jquery.js"></script>
    <style>
      body {
        position: relative;
        overflow-x: hidden;
      }
      #m {
        position: absolute;
      }
      #imgs img {
        width: 100px;
        height: 100px;
      }
    </style>
  </head>
  <body>
    <div id="imgs"></div>
    <img id="m" width="300" height="400" src="" alt="" />
  </body>
  <script>
    var imgs = [
      'https://img2.baidu.com/it/u=887369234,3509602758&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=402',
      'https://img2.baidu.com/it/u=2604691325,2667286006&fm=253&fmt=auto&app=138&f=JPEG?w=385&h=499',
      'https://tse4-mm.cn.bing.net/th/id/OIP-C.Uh3Zv0Jbo0K5PErVRDk7WQHaKy?w=204&h=297&c=7&r=0&o=5&pid=1.7',
      'https://tse3-mm.cn.bing.net/th/id/OIP-C.pT8DAupmnWX-LrKZfVds_gHaLH?w=204&h=306&c=7&r=0&o=5&pid=1.7',
    ]
    $(function () {
      $('#m')
        .css({ left: window.innerWidth + 'px' })
        .hide()
      var str = ''
      for (var i in imgs) {
        str += '<img src="' + imgs[i] + '" alt="" />'
      }
      $('#imgs').html(str)
      $('#imgs img').on('click', function () {
        $('#m').stop().show().css({ left: '1500px' })
        $('#m')
          .attr('src', $(this).attr('src'))
          .animate(
            {
              left: window.innerWidth - 320 + 'px',
            },
            3000
          )
          .show()
      })
    })
  </script>
  <script></script>
</html>
